package com.g1.gzbooksingle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.g1.gzbooksingle.mapper.DgAuthorInfoMapper;
import com.g1.gzbooksingle.model.DgAccountInfo;
import com.g1.gzbooksingle.mapper.DgAccountInfoMapper;
import com.g1.gzbooksingle.service.IDgAccountInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 支付账户表 服务实现类
 * </p>
 *
 * @author admin
 * @since 2021-10-12
 */
@Service
public class DgAccountInfoServiceImpl extends ServiceImpl<DgAccountInfoMapper, DgAccountInfo> implements IDgAccountInfoService {

    @Autowired(required = false)
    private DgAccountInfoMapper dgAccountInfoMapper;

    /**
     *
     * @param userId
     * @return
     */
    @Override
    public DgAccountInfo getByUserId(Integer userId) {
        QueryWrapper<DgAccountInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",userId);
        DgAccountInfo dgAccountInfo = dgAccountInfoMapper.selectOne(wrapper);
        return dgAccountInfo;
    }
}
